// components/choose-bankcard/choose-bankcard.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    isShowChooseBankcard: Boolean,
    list: Array
  },

  /**
   * 组件的初始数据
   */
  data: {
    
  },

  /**
   * 组件的方法列表
   */
  methods: {
    hideChooseBankcard() {
      this.triggerEvent('hideChooseBankcard')
    },
    chooseBankCard(e){
      let activeIndex = e.currentTarget.dataset.index;
      let list = this.data.list;
      for(let index=0;index<list.length;index++){
        if (index === activeIndex){
          list[index].isActive = true;
        } else {
          list[index].isActive = false;
        }
      }
      this.setData({
        "list": list
      });
      this.triggerEvent('chooseBankCard', activeIndex);
    },
    //去提现步骤1,添加银行卡 
    toStep1(){
      wx.navigateTo({
        url: '../step1/step1',
      })
    }
  }
})
